{"ast":null,"code":"var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport QuestionCircleOutlined from \"@ant-design/icons/es/icons/QuestionCircleOutlined\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Col from '../grid/col';\nimport { useLocaleReceiver } from '../locale/LocaleReceiver';\nimport defaultLocale from '../locale/en_US';\nimport Tooltip from '../tooltip';\nimport { FormContext } from './context';\nfunction toTooltipProps(tooltip) {\n  if (!tooltip) {\n    return null;\n  }\n  if (typeof tooltip === 'object' && ! /*#__PURE__*/React.isValidElement(tooltip)) {\n    return tooltip;\n  }\n  return {\n    title: tooltip\n  };\n}\nconst FormItemLabel = _ref => {\n  let {\n    prefixCls,\n    label,\n    htmlFor,\n    labelCol,\n    labelAlign,\n    colon,\n    required,\n    requiredMark,\n    tooltip\n  } = _ref;\n  const [formLocale] = useLocaleReceiver('Form');\n  if (!label) return null;\n  return /*#__PURE__*/React.createElement(FormContext.Consumer, {\n    key: \"label\"\n  }, _ref2 => {\n    let {\n      vertical,\n      labelAlign: contextLabelAlign,\n      labelCol: contextLabelCol,\n      labelWrap,\n      colon: contextColon\n    } = _ref2;\n    var _a;\n    const mergedLabelCol = labelCol || contextLabelCol || {};\n    const mergedLabelAlign = labelAlign || contextLabelAlign;\n    const labelClsBasic = `${prefixCls}-item-label`;\n    const labelColClassName = classNames(labelClsBasic, mergedLabelAlign === 'left' && `${labelClsBasic}-left`, mergedLabelCol.className, {\n      [`${labelClsBasic}-wrap`]: !!labelWrap\n    });\n    let labelChildren = label;\n    // Keep label is original where there should have no colon\n    const computedColon = colon === true || contextColon !== false && colon !== false;\n    const haveColon = computedColon && !vertical;\n    // Remove duplicated user input colon\n    if (haveColon && typeof label === 'string' && label.trim() !== '') {\n      labelChildren = label.replace(/[:|：]\\s*$/, '');\n    }\n    // Tooltip\n    const tooltipProps = toTooltipProps(tooltip);\n    if (tooltipProps) {\n      const {\n          icon = /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)\n        } = tooltipProps,\n        restTooltipProps = __rest(tooltipProps, [\"icon\"]);\n      const tooltipNode = /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, restTooltipProps), /*#__PURE__*/React.cloneElement(icon, {\n        className: `${prefixCls}-item-tooltip`,\n        title: ''\n      }));\n      labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, tooltipNode);\n    }\n    // Add required mark if optional\n    if (requiredMark === 'optional' && !required) {\n      labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, /*#__PURE__*/React.createElement(\"span\", {\n        className: `${prefixCls}-item-optional`,\n        title: \"\"\n      }, (formLocale === null || formLocale === void 0 ? void 0 : formLocale.optional) || ((_a = defaultLocale.Form) === null || _a === void 0 ? void 0 : _a.optional)));\n    }\n    const labelClassName = classNames({\n      [`${prefixCls}-item-required`]: required,\n      [`${prefixCls}-item-required-mark-optional`]: requiredMark === 'optional',\n      [`${prefixCls}-item-no-colon`]: !computedColon\n    });\n    return /*#__PURE__*/React.createElement(Col, Object.assign({}, mergedLabelCol, {\n      className: labelColClassName\n    }), /*#__PURE__*/React.createElement(\"label\", {\n      htmlFor: htmlFor,\n      className: labelClassName,\n      title: typeof label === 'string' ? label : ''\n    }, labelChildren));\n  });\n};\nexport default FormItemLabel;","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","QuestionCircleOutlined","classNames","React","Col","useLocaleReceiver","defaultLocale","Tooltip","FormContext","toTooltipProps","tooltip","isValidElement","title","FormItemLabel","_ref","prefixCls","label","htmlFor","labelCol","labelAlign","colon","required","requiredMark","formLocale","createElement","Consumer","key","_ref2","vertical","contextLabelAlign","contextLabelCol","labelWrap","contextColon","_a","mergedLabelCol","mergedLabelAlign","labelClsBasic","labelColClassName","className","labelChildren","computedColon","haveColon","trim","replace","tooltipProps","icon","restTooltipProps","tooltipNode","assign","cloneElement","Fragment","optional","Form","labelClassName"],"sources":["/data/messenger.client/node_modules/antd/es/form/FormItemLabel.js"],"sourcesContent":["var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport QuestionCircleOutlined from \"@ant-design/icons/es/icons/QuestionCircleOutlined\";\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Col from '../grid/col';\nimport { useLocaleReceiver } from '../locale/LocaleReceiver';\nimport defaultLocale from '../locale/en_US';\nimport Tooltip from '../tooltip';\nimport { FormContext } from './context';\nfunction toTooltipProps(tooltip) {\n  if (!tooltip) {\n    return null;\n  }\n  if (typeof tooltip === 'object' && ! /*#__PURE__*/React.isValidElement(tooltip)) {\n    return tooltip;\n  }\n  return {\n    title: tooltip\n  };\n}\nconst FormItemLabel = _ref => {\n  let {\n    prefixCls,\n    label,\n    htmlFor,\n    labelCol,\n    labelAlign,\n    colon,\n    required,\n    requiredMark,\n    tooltip\n  } = _ref;\n  const [formLocale] = useLocaleReceiver('Form');\n  if (!label) return null;\n  return /*#__PURE__*/React.createElement(FormContext.Consumer, {\n    key: \"label\"\n  }, _ref2 => {\n    let {\n      vertical,\n      labelAlign: contextLabelAlign,\n      labelCol: contextLabelCol,\n      labelWrap,\n      colon: contextColon\n    } = _ref2;\n    var _a;\n    const mergedLabelCol = labelCol || contextLabelCol || {};\n    const mergedLabelAlign = labelAlign || contextLabelAlign;\n    const labelClsBasic = `${prefixCls}-item-label`;\n    const labelColClassName = classNames(labelClsBasic, mergedLabelAlign === 'left' && `${labelClsBasic}-left`, mergedLabelCol.className, {\n      [`${labelClsBasic}-wrap`]: !!labelWrap\n    });\n    let labelChildren = label;\n    // Keep label is original where there should have no colon\n    const computedColon = colon === true || contextColon !== false && colon !== false;\n    const haveColon = computedColon && !vertical;\n    // Remove duplicated user input colon\n    if (haveColon && typeof label === 'string' && label.trim() !== '') {\n      labelChildren = label.replace(/[:|：]\\s*$/, '');\n    }\n    // Tooltip\n    const tooltipProps = toTooltipProps(tooltip);\n    if (tooltipProps) {\n      const {\n          icon = /*#__PURE__*/React.createElement(QuestionCircleOutlined, null)\n        } = tooltipProps,\n        restTooltipProps = __rest(tooltipProps, [\"icon\"]);\n      const tooltipNode = /*#__PURE__*/React.createElement(Tooltip, Object.assign({}, restTooltipProps), /*#__PURE__*/React.cloneElement(icon, {\n        className: `${prefixCls}-item-tooltip`,\n        title: ''\n      }));\n      labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, tooltipNode);\n    }\n    // Add required mark if optional\n    if (requiredMark === 'optional' && !required) {\n      labelChildren = /*#__PURE__*/React.createElement(React.Fragment, null, labelChildren, /*#__PURE__*/React.createElement(\"span\", {\n        className: `${prefixCls}-item-optional`,\n        title: \"\"\n      }, (formLocale === null || formLocale === void 0 ? void 0 : formLocale.optional) || ((_a = defaultLocale.Form) === null || _a === void 0 ? void 0 : _a.optional)));\n    }\n    const labelClassName = classNames({\n      [`${prefixCls}-item-required`]: required,\n      [`${prefixCls}-item-required-mark-optional`]: requiredMark === 'optional',\n      [`${prefixCls}-item-no-colon`]: !computedColon\n    });\n    return /*#__PURE__*/React.createElement(Col, Object.assign({}, mergedLabelCol, {\n      className: labelColClassName\n    }), /*#__PURE__*/React.createElement(\"label\", {\n      htmlFor: htmlFor,\n      className: labelClassName,\n      title: typeof label === 'string' ? label : ''\n    }, labelChildren));\n  });\n};\nexport default FormItemLabel;"],"mappings":"AAAA,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEP,CAAC,GAAGC,MAAM,CAACK,qBAAqB,CAACT,CAAC,CAAC,EAAEU,CAAC,GAAGP,CAAC,CAACQ,MAAM,EAAED,CAAC,EAAE,EAAE;IAC3I,IAAIT,CAAC,CAACO,OAAO,CAACL,CAAC,CAACO,CAAC,CAAC,CAAC,GAAG,CAAC,IAAIN,MAAM,CAACC,SAAS,CAACO,oBAAoB,CAACL,IAAI,CAACP,CAAC,EAAEG,CAAC,CAACO,CAAC,CAAC,CAAC,EAAER,CAAC,CAACC,CAAC,CAACO,CAAC,CAAC,CAAC,GAAGV,CAAC,CAACG,CAAC,CAACO,CAAC,CAAC,CAAC;EACnG;EACA,OAAOR,CAAC;AACV,CAAC;AACD,OAAOW,sBAAsB,MAAM,mDAAmD;AACtF,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,GAAG,MAAM,aAAa;AAC7B,SAASC,iBAAiB,QAAQ,0BAA0B;AAC5D,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,OAAO,MAAM,Y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